import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/ebook'
  },
  { 
    path: '/ebook',
    component: () => import('../views/ebook/index.vue'),
    children: [
      { 
        path: ':fileName',//设置路径名为fileName,作为参数使用,配合route.params使用
        component: () => import('../components/ebook/EbookReader.vue')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
